<template>
	<view class="viewBg">
		<view class="deptInfo">部门名称：{{deptName}}</view>
		<view class="deptInfo">
			职责范围：{{deptArea}}
		</view>
		<view class="lineH20"></view>
		<view class="uni-list">
			<view class="uni-list-cell" v-for="(item,index) in list" :key="index">
				<view class="uni-list-cell-navigate">
					<text>{{item.name}}</text>
					<text>{{item.phone}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				searchKey: '',
				current: 0,
				activeColor: '#007aff',
				styleType: 'button',

				reload: false,

				pageNo: 1,
				viewStatus: 0,
				deptName: '',
				deptArea: '',
				gridId: ''
			};
		},
		onLoad(data) {
			this.gridId = data.gridId;
			this.deptName = data.deptName;
			this.deptArea = data.duty;
			this.getList();
		},
		onReachBottom() {
			this.pageNo++;
			this.getList();
		},
		methods: {
			getList() {
				const _gridId = this.gridId;
				this.reload = false;
				uni.stopPullDownRefresh();
				this.$http.get('ac/xagrid/appDepartmentService/getDepartmentUserList', {
					pageNo: this.pageNo,
					pageSize: 10,
					gridId: _gridId
				}).then((res) => {
					if (res.errcode === '0') {
						const obj = res.data.results;
						if (obj.length > 0) {
							this.list = this.list.concat(obj);
						}
					} else {
						console.log("错误信息" + res.errmsg);
						uni.showToast({
							title: res.errmsg,
							mask: false,
							duration: 1500
						});
					}
				});
			}
		}
	}
</script>

<style>
	.viewBg {
		width: 100%;
		height: 100%;
		/* background-color: #0FAEFF; */
	}

	.deptInfo {
		margin-left: 20upx;

	}

	.lineH20 {
		height: 20upx;
		width: 100%;
		background-color: #F7F7F7;
	}

	.uni-list-cell-navigate {
		width: 100%;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-items: flex-start;
	}
</style>
